package cn.livingCloud.dto;

import cn.livingCloud.entity.core.Case;
import cn.livingCloud.entity.core.CaseStatus;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by DingJie on 2016/6/2.
 */
public class CaseListDto extends Page<CaseDto> {
    //列表状态[已完成,未完成]
    protected CaseListStatus listStatus;
    private String key;
    private CaseStatus status;
    private String startTime;
    private String endTime;
    private String categoryUuid;
    private List<CaseCategoryDto> caseCategoryDtoList = new ArrayList<>();
    //    private List<String> deptUuids = new ArrayList<>();
    private String deptUuids;
    private String ownerUuid;
    private String creatorUuid;

    //多人模式下查询条件
    private int max = -1;
    private int resultRow = -1;
    //多人模式
    private boolean multi = true;

    private int stubbornCount = -1;

    public CaseListDto() {
        this.listStatus = CaseListStatus.UN_COMPLETE;
    }

    public List<CaseCategoryDto> getCaseCategoryDtoList() {
        return caseCategoryDtoList;
    }

    public void setCaseCategoryDtoList(List<CaseCategoryDto> caseCategoryDtoList) {
        this.caseCategoryDtoList = caseCategoryDtoList;
    }

    public String getCategoryUuid() {
        return categoryUuid;
    }

    public CaseListDto setCategoryUuid(String categoryUuid) {
        this.categoryUuid = categoryUuid;
        return this;
    }

    public String getKey() {
        return key;
    }

    public CaseListDto setKey(String key) {
        this.key = key;
        return this;
    }

    public CaseStatus getStatus() {
        return status;
    }

    public void setStatus(CaseStatus status) {
        this.status = status;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public CaseStatus[] getAllStatus() {
        return CaseStatus.values();
    }

    public String getDeptUuids() {
        return deptUuids;
    }

    public CaseListDto setDeptUuids(String deptUuids) {
        this.deptUuids = deptUuids;
        return this;
    }

    public String getOwnerUuid() {
        return ownerUuid;
    }

    public CaseListDto setOwnerUuid(String ownerUuid) {
        this.ownerUuid = ownerUuid;
        return this;
    }

    public String getCreatorUuid() {
        return creatorUuid;
    }

    public CaseListDto setCreatorUuid(String creatorUuid) {
        this.creatorUuid = creatorUuid;
        return this;
    }

    public CaseListStatus getListStatus() {
        return listStatus;
    }

    public CaseListDto setListStatus(CaseListStatus listStatus) {
        this.listStatus = listStatus;
        return this;
    }

    public CaseListStatus[] getAllCaseListStatus() {
        return CaseListStatus.values();
    }

    @Override
    public void addAllList(List items) {
        for (Object item : items) {
            list.add(new CaseDto((Case) item));
        }
    }

    public int getResultRow() {
        return resultRow;
    }

    public CaseListDto setResultRow(int resultRow) {
        this.resultRow = resultRow;
        return this;
    }

    public int getMax() {
        return max;
    }

    public CaseListDto setMax(int max) {
        this.max = max;
        return this;
    }

    public boolean isMulti() {
        return multi;
    }

    public CaseListDto setMulti(boolean multi) {
        this.multi = multi;
        return this;
    }

    public int getStubbornCount() {
        return stubbornCount;
    }

    public CaseListDto setStubbornCount(int stubbornCount) {
        this.stubbornCount = stubbornCount;
        return this;
    }
}
